UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tgZV6zmlS/cJdH2bLrhAeAd0VO/8eBxzCx2gUANUXJA='
WHERE
key_id = 'fe757c3a0f6d3b70a6c3dab110f302ac863554a3c8918a823eb7f06a5c4ae644'
AND (
token = 'tgZV6zmlS/cJdH2bLrhAeAd0VO/8eBxzCx2gUANUXJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)