UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7lOq6frrkMv7+nsYJsFD2t0bg5cC9/c6F7CjgMVVEeY=' 
WHERE 
  key_id = '1c33925123aa194bd3d0a178fee5dcdae42bf56816636980811f720fa679b347' 
  AND (
    token = '7lOq6frrkMv7+nsYJsFD2t0bg5cC9/c6F7CjgMVVEeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022