UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'svCZwQf8O+6A/cb/frr4ME+UMMpTDSkeM59V8YEdlmM=' 
WHERE 
  key_id = 'b4b1feadefb56575fcfb730f9edfd5f99629b9a166285544a5ba1d1a81ae780d' 
  AND (
    token = 'svCZwQf8O+6A/cb/frr4ME+UMMpTDSkeM59V8YEdlmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031