UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7lkQ/rBAF9hby+ZokKLyUm86kcfRIRr/blsA0SGLWQ=' 
WHERE 
  key_id = '3c473be700d121b94c1e3df563faa9830204f1a64fc98f1ae5accd32f36aca02' 
  AND (
    token = '/7lkQ/rBAF9hby+ZokKLyUm86kcfRIRr/blsA0SGLWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026