UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wl7tvMMNyvlurDD2WJ/uZ+B03fY4Nraub5oyiSQ0R44=' 
WHERE 
  key_id = '6153ac23f974c8211f35b578c5b075b55362d3e48f0052038d6e1831ad1aa1dd' 
  AND (
    token = 'Wl7tvMMNyvlurDD2WJ/uZ+B03fY4Nraub5oyiSQ0R44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016