UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gwuyzjkAJ1DHNXZVoAL638xqVYO6UwTofFJ6IyXfMrc=' 
WHERE 
  key_id = 'a70990eb826e66751604114e066a229bbf60e6b0786303f7892f4ccb21906fdb' 
  AND (
    token = 'gwuyzjkAJ1DHNXZVoAL638xqVYO6UwTofFJ6IyXfMrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022