UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '11qra6J7oWzLbVpPs+gL/Q5mwmCnvC1MlGNTJX945oU=' 
WHERE 
  key_id = '9370bf85daecd8e2fa202337617f4a2f3e65098b6da6617efd0fffbe9e36369c' 
  AND (
    token = '11qra6J7oWzLbVpPs+gL/Q5mwmCnvC1MlGNTJX945oU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049