UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JfJPzuKrXw4logKEklzv3WnDX+sogwplY72T51F6Ldg='
WHERE
key_id = 'df1d4040a33471b18ebf8f6ee47a8814d1ec4cf8336709f2f961b86d56448148'
AND (
token = 'JfJPzuKrXw4logKEklzv3WnDX+sogwplY72T51F6Ldg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)