UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gfuw1PDELAHHCJ/x1mgVqXgCs9PUv5lGonQTPpP4zrE=' 
WHERE 
  key_id = '3fd35b5ab031883d1b732ecc114e0f89d4dc3e345d6bb72945b3e057904bf206' 
  AND (
    token = 'gfuw1PDELAHHCJ/x1mgVqXgCs9PUv5lGonQTPpP4zrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019