UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGLOeWcq20ExBfN9eUs+7/8qnLyVK0CRX4GfSCCisus=' 
WHERE 
  key_id = '4a48d562e0b87b24d8515e5a426600b044b66a59930de279465835c6cf1363b6' 
  AND (
    token = 'GGLOeWcq20ExBfN9eUs+7/8qnLyVK0CRX4GfSCCisus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027