UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6WBsFy259W0689K+5s+/EwIxW/xc7xMDfjHVHHCEIvw=' 
WHERE 
  key_id = 'fd3b2de4c0130dcfe22a6c0f3d76756c788acc2b80d9abe711f8fbdb2da6a018' 
  AND (
    token = '6WBsFy259W0689K+5s+/EwIxW/xc7xMDfjHVHHCEIvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029