UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zo329mxID7DuOCEvAZvzsP7BssE6koG4SzYRmdKHzUg='
WHERE
key_id = 'd0aff0c5f88038ef40a9ab411508d57b28b252d10f2b3f89e64df7fa4251a96f'
AND (
token = 'zo329mxID7DuOCEvAZvzsP7BssE6koG4SzYRmdKHzUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)