UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iVSN7UgIGVEdTRz4FVY3rGcMdSSBp4O2v+iopUniYZg='
WHERE
key_id = '48ad3a4e4bb805b12e2f026b0a364125c6aeb422fd37d450ad549f26616b9f45'
AND (
token = 'iVSN7UgIGVEdTRz4FVY3rGcMdSSBp4O2v+iopUniYZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)