UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ADRPVTmGPZ2QdLUvoCdeSIoDoNujwh++rzB7kJl71Fo='
WHERE
key_id = '9bf01cefebb3d194f21782b615ed01eb021c793cef1372daff34cb8a2639efc6'
AND (
token = 'ADRPVTmGPZ2QdLUvoCdeSIoDoNujwh++rzB7kJl71Fo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)