UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6I7Nh7rq0qUTc8y5EqQRw8tJ83RmPDwMXZQQr1H+2vQ=' 
WHERE 
  key_id = '090469b81e45063e866e91438ee816e6698a30613a1216079d592a81b619235d' 
  AND (
    token = '6I7Nh7rq0qUTc8y5EqQRw8tJ83RmPDwMXZQQr1H+2vQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019