UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4kTHW00qkwTDUJRD2Nv5wHId7Ba44kkxkVgEZxOL/+Y='
WHERE
key_id = 'ab2dde4c3677cfb4b1e766f88ae5664f8ed843d5519a5d94c2c3f51e75a92a2e'
AND (
token = '4kTHW00qkwTDUJRD2Nv5wHId7Ba44kkxkVgEZxOL/+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)