UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IIE4N1EQ6OTyZOol4MvgyKNHTpNrKJcFaBXo/YBBwKs=' 
WHERE 
  key_id = 'f46d7f4ef22973d220943e4a2d67e0380fb55c9e7d32c85b5bcd97117cdb7921' 
  AND (
    token = 'IIE4N1EQ6OTyZOol4MvgyKNHTpNrKJcFaBXo/YBBwKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037