UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8GywkM906iK3Eytlnv3Y4Mj1E4qrID+6ViIrfk+FTEc='
WHERE
key_id = '5599021d39e63d6c5916c3971b0cfc00e03d61a94f6323a758fd6da095170b03'
AND (
token = '8GywkM906iK3Eytlnv3Y4Mj1E4qrID+6ViIrfk+FTEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)