UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jU96jWK23P72ujkOB7pVKwtiGgm3IbMK9URo2GBRWRk=' 
WHERE 
  key_id = '015b4aecd1f586df8ba6f0f9ed29be53b6e333d99a099d9eb42538a4f841d7ee' 
  AND (
    token = 'jU96jWK23P72ujkOB7pVKwtiGgm3IbMK9URo2GBRWRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066