UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u7wZOGiMygziVKvVeznuBmuby0A17qYoBnhxEViqUoI='
WHERE
key_id = '0e9acecf894986e096dfaba8dd0b0f3ad90ef2ccff28426c55bb9f17efb56753'
AND (
token = 'u7wZOGiMygziVKvVeznuBmuby0A17qYoBnhxEViqUoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)