UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HTalwM0XtlX2Cav86mfqMKHSrRKIRMh/63XhUB1NfSM='
WHERE
key_id = 'c30db76435ca5f7d16e468d3f7a844809ac8355e1cd114e878922166cb56e8fe'
AND (
token = 'HTalwM0XtlX2Cav86mfqMKHSrRKIRMh/63XhUB1NfSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)