UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UpZzNJWaaRycOyYKaxuXEICWrELw64YWFKT+Sx4VpgQ=' 
WHERE 
  key_id = '95f0865edf5267ef6c7eb12299054838cd9bd573ccadcb0eeb1622157c1559f7' 
  AND (
    token = 'UpZzNJWaaRycOyYKaxuXEICWrELw64YWFKT+Sx4VpgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019