UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OJ6LXYCvObFLfMbJ/O0a7F8/R3rlp5l+JZbxglqAFnU=' 
WHERE 
  key_id = '582ef386bfd209bef3936031761b6e7467c0e9ed2e5eac915616d709ebd47fcb' 
  AND (
    token = 'OJ6LXYCvObFLfMbJ/O0a7F8/R3rlp5l+JZbxglqAFnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027