UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KMsABM/Nb8/FrMJcBemrUHo0dc/FT7iN0Ajui0iZnSs=' 
WHERE 
  key_id = '558c10953f281ac5c56976a9c0865147b1ed43b34b65ceaec38cf01705689cd7' 
  AND (
    token = 'KMsABM/Nb8/FrMJcBemrUHo0dc/FT7iN0Ajui0iZnSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032