UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BoUX9UzLrcVqysD72Ku86BpMs1IBJyD/mnn6cxR7A00=' 
WHERE 
  key_id = 'a6536983f2d290b105ab017f1278973d5fa9d8c2606671dcb3b08c7876984e21' 
  AND (
    token = 'BoUX9UzLrcVqysD72Ku86BpMs1IBJyD/mnn6cxR7A00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030