UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kDEtvZ73pdlMWMLQ+t5wWkEA66Fx7KlikUi9xKge+WE=' 
WHERE 
  key_id = '89ba5f828565a414f0e02b7544e7721d9a96d3bdab60fa491848131a0b91e481' 
  AND (
    token = 'kDEtvZ73pdlMWMLQ+t5wWkEA66Fx7KlikUi9xKge+WE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028