UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7TN8ZgJ5i+GK6IVOj/P9d2uDrjGxiZB/+4+rFPJZWMc=' 
WHERE 
  key_id = '3421dc8047ebef2d20ac6372af17ae20f236cb3ac406c4d98db1f70e4d55c19f' 
  AND (
    token = '7TN8ZgJ5i+GK6IVOj/P9d2uDrjGxiZB/+4+rFPJZWMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038