UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rzo3gUDzgjxil/XE4/qwaRROtlsrxowYJHks2Pix61Q=' 
WHERE 
  key_id = 'a4e58da35d013194ef52e3e1b4aa03879c5c3df39c8633ebfc12321261289ab4' 
  AND (
    token = 'Rzo3gUDzgjxil/XE4/qwaRROtlsrxowYJHks2Pix61Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024