UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ltSILXOPrdBfaOvDpQ75900HA8q0Jph6OjvTOXsLy88='
WHERE
key_id = '90c2ac2a7329a061ba2ca83acde13db003f68c768dfd1596d016bd7ddc32a146'
AND (
token = 'ltSILXOPrdBfaOvDpQ75900HA8q0Jph6OjvTOXsLy88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)