UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zqXAqSSu2teSFnChB55iAuOolRDbU/oQYp6mo1ysKdQ=' 
WHERE 
  key_id = '9fa68d43d0d00a25f44b9141f4b1533de7a7c2399edbc26885e2a63d3cd93201' 
  AND (
    token = 'zqXAqSSu2teSFnChB55iAuOolRDbU/oQYp6mo1ysKdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017