UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nkL1RA4Pn0TkyWSPYIyJvt4/wRY6Ki5zGUKxQmqt5I='
WHERE
key_id = 'ab28931ead281d327ba80cc4b5c1c504c9a5c1949cd885dfb25737ce6951e541'
AND (
token = '9nkL1RA4Pn0TkyWSPYIyJvt4/wRY6Ki5zGUKxQmqt5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)