UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vGkz3tXEKi0zOEMqT3AZ/4yeVbnrQ48/CzXNPB0crz4=' 
WHERE 
  key_id = '3981485c1f49a43ebc25f9bf2c8db5b9df8cd99467cb69c2ab26b50619ec3915' 
  AND (
    token = 'vGkz3tXEKi0zOEMqT3AZ/4yeVbnrQ48/CzXNPB0crz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049