UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BdhDKbCQ3fugD3bqoxXSZUrrTL1rQhvRNo7XQasyWw0='
WHERE
key_id = '4374af0217c3294e6ee48024d1be49e2231ec9bf21f33f02ef805d9a8dddddd8'
AND (
token = 'BdhDKbCQ3fugD3bqoxXSZUrrTL1rQhvRNo7XQasyWw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)