UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jrmgm3TPcUotHFt6C1qzeQxkGMJPU/GRY0Zr3Zjd2K0=' 
WHERE 
  key_id = 'df5febd0dd096c97841572de392b9fee0c33ab9974fd1a82336507bc26bec3ea' 
  AND (
    token = 'jrmgm3TPcUotHFt6C1qzeQxkGMJPU/GRY0Zr3Zjd2K0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034