UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05B7A+54UvMbheauhmb+jJzVgAzv8+I7HevHyeQkxOc='
WHERE
key_id = '63fb7ed9332eedacca06f24c0f1569215149dbbe7ecc1e0434e34f5dc8116634'
AND (
token = '05B7A+54UvMbheauhmb+jJzVgAzv8+I7HevHyeQkxOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)