UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3PMwb4mO0ihjAtJ8JdPvTH5OCnZXuavT4OJPqQoT21c=' 
WHERE 
  key_id = '11dc33b9fd2975d1ba2966298d9808397c703e9dfbe7029a0f87222f8ac362e1' 
  AND (
    token = '3PMwb4mO0ihjAtJ8JdPvTH5OCnZXuavT4OJPqQoT21c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023