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

Query time 0.00031