UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qJg2uEoA+JuppoX85bVxOeWutljFSvT7W63eHhkd1eo='
WHERE
key_id = '528ff44186f0aa56c7bee88f2d58b092c6cf92ea450bd994bcea39d6434219c3'
AND (
token = 'qJg2uEoA+JuppoX85bVxOeWutljFSvT7W63eHhkd1eo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)