UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSDqXW6W7Y+9FKe5xXDxR/7IaLoDt4AUybQj0/N0UzI='
WHERE
key_id = '5a7e6f8e35fdab7fa3839d29d2e58b75b6cbd4c46d848018cad5c287e301ce83'
AND (
token = 'WSDqXW6W7Y+9FKe5xXDxR/7IaLoDt4AUybQj0/N0UzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)