UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rft/wokf4/T1hm9tfFleP6w0kPiVdMNPMIKCoo5blk=' 
WHERE 
  key_id = 'a80158c605dbb4a0b07687e92f687fc7ca393ec6c0e52dee58fce9e4ba5b4193' 
  AND (
    token = '1rft/wokf4/T1hm9tfFleP6w0kPiVdMNPMIKCoo5blk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033