UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Csw4CTU8W8g/YM/M+nZCq3DYZRGmfH9EU89khNK918='
WHERE
key_id = '69a5a7d3fc861f508724d3d8b78c68e929bc9f8673283189a3483349067a3d2d'
AND (
token = '2Csw4CTU8W8g/YM/M+nZCq3DYZRGmfH9EU89khNK918='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)