UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxJm8AcnpLxC2+2otAMM7jkHj5vrSYcga9DJKD1RgDo='
WHERE
key_id = 'c04fa3317eab0fc1f40cd5330e66c966ce4dd299626b9655895cfa9b34a1082e'
AND (
token = 'GxJm8AcnpLxC2+2otAMM7jkHj5vrSYcga9DJKD1RgDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)