UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XGS+IuYACeM9fKLnJoEnLP/DEtoXvlbbV8D+Ta2CKv8=' 
WHERE 
  key_id = '06791ed230aa38d477d06099cb7c36432cbded98a7bd846677151a75e67b5942' 
  AND (
    token = 'XGS+IuYACeM9fKLnJoEnLP/DEtoXvlbbV8D+Ta2CKv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034