UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H5s1JyRfiScBvwp0tDaYqsNMet+zrpA0AC6LxDjCWfo=' 
WHERE 
  key_id = '33d710019e0d2226074909606140a64cff5db185af7a420355718fe27deb6aa8' 
  AND (
    token = 'H5s1JyRfiScBvwp0tDaYqsNMet+zrpA0AC6LxDjCWfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028