UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kCSbfi7zsU4t8ji60sgzTs+pvtmgp1GtmoEyEAFFOJ0='
WHERE
key_id = '15a9a2ac3eef6bd36ca8240a72cb3fde80162982aa2a2603dee8691b363645a0'
AND (
token = 'kCSbfi7zsU4t8ji60sgzTs+pvtmgp1GtmoEyEAFFOJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)